package com.chixing.day_07_prototype.product.work;

public class Mainboard {
    //创建有参构造体，传入显卡和芯片
    private Cpu cpu;
    private VideoCard videoCard;

    public Mainboard(Cpu cpu, VideoCard videoCard) {
        this.cpu = cpu;
        this.videoCard = videoCard;
    }

    public Mainboard() {
    }

    //run():显示主板运行信息
    public void run(){
        System.out.println("主板启动...");
        cpu.cpuRunning();
        videoCard.videoRunning();
    }

    //显示主板停止信息
    public void close(){
        System.out.println("主板关闭...");
        cpu.cpuClosing();
        videoCard.videoClosing();
    }

}
